/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package negocio;

import DAO.EnderecoJpaController;
import dominio.Endereco;

/**
 *
 * @author gilcemar e naliane
 */
public class EnderecoNegocio {
    EnderecoJpaController endDao = new EnderecoJpaController();

    public void incluirEnd (Endereco end)
    {
        try
        {
            endDao.create(end);
        }catch (Exception e)
        {
            e.getStackTrace();
        }
    }

    public void alterarEnd (Endereco endereco)
    {
        try
        {
            endDao.edit(endereco);
        }catch (Exception e)
        {
            StackTraceElement[] stackTrace = e.getStackTrace();
        }
    }

    public Endereco pesquisarEndereco (String cpf)
    {
        try
        {
            return endDao.findEndereco(cpf);
        }catch(Exception e)
        {
            e.getStackTrace();
            return null;
        }
    }
}
